<?php
namespace Admin\Controller;
use Think\Controller;
class ScanController extends Controller//CommonController
{
	public function index(){
		session('page_size',$_GET['page_size']);
    	$page_no = I('get.p') ? I('get.p') : 1;
        $page_size = I('get.page_size') ? I('get.page_size') : 10;
    	$data = M('scan a')
    		->where()
    		->page($page_no, $page_size)
    		->field('a.id,a.shop_id,a.add_time,a.number,c.shop_name')
    		->join("left join zm_shop c on a.shop_id=c.id")
            ->order('id desc')
    		->select();
    
    	$count =M('scan')->where()->count();
        $Page = new \AntAge\Page($count, $page_size);
        $show = $Page->show();
        $this->assign('type',$_SESSION['type']);
        $this->assign('page', $show);
        $this->assign("count", $count);
        $this->assign("data", $data);
		$this->display();
	}

    public function test(){
        $res = M('device_status_next')->where("id=70")->find();
        dump($res);exit;
    }
}